/**
 */
package com.my.customtask.MyModel.impl;

import com.my.customtask.MyModel.Connector;
import com.my.customtask.MyModel.MyModelPackage;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.js.model.rbac.Role;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Connector</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link com.my.customtask.MyModel.impl.ConnectorImpl#getRole <em>Role</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ConnectorImpl extends EObjectImpl implements Connector {
   /**
    * The cached value of the '{@link #getRole() <em>Role</em>}' reference.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @see #getRole()
    * @generated
    * @ordered
    */
   protected Role role;

   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   protected ConnectorImpl() {
      super();
   }

   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   @Override
   protected EClass eStaticClass() {
      return MyModelPackage.Literals.CONNECTOR;
   }

   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   public Role getRole() {
      if (role != null && role.eIsProxy()) {
         InternalEObject oldRole = (InternalEObject)role;
         role = (Role)eResolveProxy(oldRole);
         if (role != oldRole) {
            if (eNotificationRequired())
               eNotify(new ENotificationImpl(this, Notification.RESOLVE, MyModelPackage.CONNECTOR__ROLE, oldRole, role));
         }
      }
      return role;
   }

   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   public Role basicGetRole() {
      return role;
   }

   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   public void setRole(Role newRole) {
      Role oldRole = role;
      role = newRole;
      if (eNotificationRequired())
         eNotify(new ENotificationImpl(this, Notification.SET, MyModelPackage.CONNECTOR__ROLE, oldRole, role));
   }

   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   @Override
   public Object eGet(int featureID, boolean resolve, boolean coreType) {
      switch (featureID) {
         case MyModelPackage.CONNECTOR__ROLE:
            if (resolve) return getRole();
            return basicGetRole();
      }
      return super.eGet(featureID, resolve, coreType);
   }

   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   @Override
   public void eSet(int featureID, Object newValue) {
      switch (featureID) {
         case MyModelPackage.CONNECTOR__ROLE:
            setRole((Role)newValue);
            return;
      }
      super.eSet(featureID, newValue);
   }

   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   @Override
   public void eUnset(int featureID) {
      switch (featureID) {
         case MyModelPackage.CONNECTOR__ROLE:
            setRole((Role)null);
            return;
      }
      super.eUnset(featureID);
   }

   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   @Override
   public boolean eIsSet(int featureID) {
      switch (featureID) {
         case MyModelPackage.CONNECTOR__ROLE:
            return role != null;
      }
      return super.eIsSet(featureID);
   }

} //ConnectorImpl
